package com.zhu.library_management_system.service;

import com.zhu.library_management_system.pojo.Book;

public interface BookService {

    /**
     * 查询所有书籍
     * @return
     */
    public Iterable<Book> findAllBooks();

    /**
     * 根据id查询书籍
     * @param id
     * @return
     */
    public Book findBookById(Integer id);

    /**
     * 根据书名查询
     * @param title
     * @return
     */
    public Book findBookByTitle(String title);

    /**
     * 更新书籍
     * @param book
     * @return
     */
    public void updateBook(Book book);

    /**
     * 删除书籍
     * @param id
     */
    public void deleteBook(Integer id);

    /**
     * 添加书籍
     * @param book
     */
    public void addBook(Book book);

    /**
     * 获取书籍状态
     * @param bookId
     * @return
     */
    public String getBookStatus(Integer bookId);

    /**
     * 更新书籍状态
     * @param bookId
     * @param bookStatus
     */
    public void updateBookStatus(Integer bookId, String bookStatus);

    /**
     * 查询库存
     * @param bookId
     */
    public Integer findStock(Integer bookId);

    /**
     * 库存增减
     * @param bookId
     * @param stock
     */
    public void stock(Integer bookId, Integer stock);

}
